<template>
    <div>
        <h1>axios</h1>
    </div>
</template>

<script>
import axios from "axios";
// import { directive } from "vue/types/umd";
    export default {
        created(){
            console.log(axios);
            console.dir(axios);

            axios({
                method:"get",
                baseURL:"https://autumnfish.cn",
                url:"/search",
                transformRequest:[
                    function(data){
                        console.log(data);
                        return data;
                    },
                ],
                transformResponse:[
                    function (data){
                        console.log(data);
                        data = JSON.parse(data);
                        return data;
                    },
                ],
                params: {
                    keywords: "haohao",
                },
                data:{},
                timeout: 1000,
            })
            .then((res) => {
                console.log(res);
                console.log(res.data.result.songs);
            })
            .catch((err) => {
                console.log(err);
            });
        },
    };
</script>

<style lang="scss" scoped>

</style>